package com.itheima01;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class InetAddressDemo {
    public static void main(String[] args) throws UnknownHostException {
        InetAddress inetAddress = InetAddress.getByName("10.0.24.3");

        String hostName = inetAddress.getHostName();

        String hostAddress = inetAddress.getHostAddress();

        System.out.println("主机名：" + hostName);
        System.out.println("IP地址：" + hostAddress);
    }
}
